﻿--Check the version to avoid duplicate update
declare @versionId nvarchar(50) 
SELECT @versionId = 'Version2'
if exists (select VersionId from __DataVersion where VersionId = @versionId )
BEGIN
	RETURN
END

--Insert version first
insert into __DataVersion (VersionId, Note) VALUES (@versionId, 'Version2 Desc')

/*
* Handle data changes here
*/
insert into [$(TableName)] (Id, [Name],[Address],[ManagerId],[Title]) values (1, 'N1', 'A1', NULL, 1)
insert into [$(TableName)] (Id, [Name],[Address],[ManagerId],[Title]) values (2, 'N2', 'A2', 3, 2)
insert into [$(TableName)] (Id, [Name],[Address],[ManagerId],[Title]) values (3, 'N3', 'A3', 4, 3)
insert into [$(TableName)] (Id, [Name],[Address],[ManagerId],[Title]) values (4, 'N4', 'A4', 5, 4)
insert into [$(TableName)] (Id, [Name],[Address],[ManagerId],[Title]) values (5, 'N5', 'A5', 6, 5)
insert into [$(TableName)] (Id, [Name],[Address],[ManagerId],[Title]) values (6, 'N6', 'A5', 6, 6)